package com.oliver.picturebackend.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.oliver.picturebackend.model.dto.picture.PictureQueryRequest;
import com.oliver.picturebackend.model.dto.picture.PictureReviewRequest;
import com.oliver.picturebackend.model.dto.picture.PictureUploadByBatchRequest;
import com.oliver.picturebackend.model.dto.picture.PictureUploadRequest;
import com.oliver.picturebackend.model.entity.Picture;
import com.baomidou.mybatisplus.extension.service.IService;
import com.oliver.picturebackend.model.entity.User;
import com.oliver.picturebackend.model.vo.PictureVO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;

/**
* @author snow
* @description 针对表【picture(图片)】的数据库操作Service
* @createDate 2024-12-13 20:43:11
*/
public interface PictureService extends IService<Picture> {

    /**
     * 上传图片
     *
     * @param inputSource
     * @param pictureUploadRequest
     * @param loginUser
     * @return
     */
    PictureVO uploadPicture(Object inputSource,
                            PictureUploadRequest pictureUploadRequest,
                            User loginUser);

    /**
     * 通用的分页查询
     * @param request
     * @return
     */
    QueryWrapper<Picture> getQueryWrapper(PictureQueryRequest request);

    /**
     * VO类转换
     * @param picture
     * @param request
     * @return
     */
    PictureVO getPictureVO(Picture picture, HttpServletRequest request);

    /**
     * VO类的列表转换
     * @param picturePage
     * @param request
     * @return
     */
    Page<PictureVO> getPictureVOPage(Page<Picture> picturePage, HttpServletRequest request);

    /**
     * 图片的校验
     * @param picture
     */
    void validPicture(Picture picture);

    /**
     * 图片审核
     *
     * @param pictureReviewRequest
     * @param loginUser
     */
    void doPictureReview(PictureReviewRequest pictureReviewRequest, User loginUser);

    /**
     * 设置图片审核状态
     * @param picture
     * @param loginUser
     */
    void fillReviewParams(Picture picture, User loginUser);


    int uploadPictureByBatch(PictureUploadByBatchRequest pictureUploadByBatchRequest, User loginUser);
}
